/** @jsxImportSource @emotion/react */
import * as React from "react";
import {ReportViewProps,} from "../../common/base";
import {末尾链接, 落款单位地址,} from "../../common/rarelyVary";
import {Text, useTheme} from "customize-easy-ui-component";
import {useRepMenuDirItems} from "../../hook/useMainRepUrlOr";
import {ReportFirstPageHeadNmaNmbm} from "../../contain/rarelyVary";
import {首页设备概况BulkI} from "./rarelyVary";
import {ConclusionVw} from "./Conclusion";
import {InspectionItemVw} from "./InspectionItem";
import {编制审核Utili} from "../../gas/utilityNj/viewRes";
import {Projects记录} from "./Regular.O-1";
import {useItemsMapPressure} from "../../common/pressure";
import {目录页VS} from "../../movable/rarelyVary";
import {注意事项GasC} from "../../gas/rarelyVary";
import {CertificatePage} from "./CertificatePage";

export const ReportView: React.FunctionComponent<ReportViewProps> = ({
    repId,   source: orc,  verId,rep,
}) => {
    const theme= useTheme();
    const [mapFxian]=useItemsMapPressure({ projects:orc.Projects });
    const [rootMenu]=useRepMenuDirItems(Projects记录, orc.Projects, `/reportView/${rep?.modeltype}/ver/${verId}/${repId}`);
  return (
    <React.Fragment>
        {rootMenu}
        <div css={{"@media not print": {marginTop: '1rem', marginBottom: '1rem'}}}>
            <CertificatePage orc={orc} rep={rep}/>

            <div css={{
                display: 'flex',
                flexDirection: 'column',
                justifyContent: 'space-between',
                "@media print": {height: '100vh', pageBreakInside: 'avoid',}
            }}>
                {ReportFirstPageHeadNmaNmbm({theme, rep, mbbm: 'FJB/TM-1007-1-0-2022'})}
                <div>
                    <Text variant="h3" css={{
                        textAlign: 'center',
                        "@media (min-width:690px),print and (min-width:538px)": {
                            fontSize: theme.fontSizes[6],
                        }
                    }}>
                     散装工业锅炉安装监督检验报告
                    </Text>
                    <br css={{"@media not print": {display: 'none'}}}/>
                    <Text variant="h5" css={{textAlign: 'center',}}> （ FJB/GB 1012-1-2021 ）</Text>
                </div>
                <div>
                  {首页设备概况BulkI({theme, orc, rep})}
                </div>
                <div css={{textAlign: 'center', "@media print": {pageBreakInside: 'avoid'}}}>
                    {落款单位地址}
                </div>
            </div>
            {注意事项GasC({
                rep,
                comply: '书为依据《锅炉安全技术规程》制定，适用于散装工业锅炉安装监督检验报告的结论报告'
            })}
            {目录页VS({theme, orc, rep})}
            <ConclusionVw orc={orc} rep={rep}/>
            {编制审核Utili({theme, orc, rep,bcap:'监检',pcap:'批准'})}
            <InspectionItemVw orc={orc} rep={rep}/>
        </div>
        {末尾链接({template: rep?.modeltype, verId, repId: repId || ''})}
    </React.Fragment>
  );
}
